Ext.user.edit = {};
Ext.user.edit.binzhong = {xtype: 'combo',	name:'binzhong', valueField:'id',store: Ext.user.method.store(['id', 'name'],Ext.user.data.binzhong),displayField:'name',typeAhead: true,forceSelection: true,mode:'local',triggerAction: 'all',emptyText:'请选择',	selectOnFocus:true}
Ext.user.edit.askway = {xtype: 'combo',	name:'askway', valueField:'id',store: Ext.user.method.store(['id', 'name'],Ext.user.data.askway),displayField:'name',typeAhead: true,forceSelection: true,mode:'local',triggerAction: 'all',emptyText:'请选择',	selectOnFocus:true}
Ext.user.edit.sex = {xtype: 'combo',	name:'sex', valueField:'id',store: Ext.user.method.store(['id', 'name'],Ext.user.data.sex),displayField:'name',typeAhead: true,forceSelection: true,mode:'local',triggerAction: 'all',emptyText:'请选择',	selectOnFocus:true}
Ext.user.edit.visit = {xtype: 'combo',	name:'visit', valueField:'id',store: Ext.user.method.store(['id', 'name'],Ext.user.data.visit),displayField:'name',typeAhead: true,forceSelection: true,mode:'local',triggerAction: 'all',emptyText:'请选择',	selectOnFocus:true}

Ext.user.yuyuecolumn = new Ext.grid.ColumnModel([
                    new Ext.grid.RowNumberer(),
                    {xtype: 'datecolumn', header: '时间',dataIndex: 'time',align: 'center',width: 85,editor: {xtype: 'datefield'}},
                    {xtype: 'gridcolumn', header: 'IP地址',dataIndex: 'ipaddr',width: 85,editor: { xtype: 'textfield'}},
                    {xtype: 'gridcolumn', header: '地区',dataIndex: 'city',width: 85,editor: { xtype: 'textfield'}},
                    {xtype: 'gridcolumn', header: '进入页',dataIndex: 'gopage',width: 200,editor: { xtype: 'textfield'}},
					{xtype: 'gridcolumn', header: '咨询页',dataIndex: 'askpage',width: 200,editor: { xtype: 'textfield'}},
					{xtype: 'gridcolumn', header: '搜索引擎/关键字',dataIndex: 'keyword',width: 120,editor: { xtype: 'textfield'}},
					{xtype: 'gridcolumn', header: '病种',dataIndex: 'binzhong',width: 85,editor:Ext.user.edit.binzhong,renderer:Ext.user.renderer.binzhong},
					{xtype: 'gridcolumn', header: '咨询渠道',dataIndex: 'askway',width: 85,editor:Ext.user.edit.askway,renderer:Ext.user.renderer.askway},
					{xtype: 'gridcolumn', header: 'QQ号（选填）',dataIndex: 'qq',width: 85,editor: { xtype: 'textfield'}},
					{xtype: 'gridcolumn', header: '咨询员',dataIndex: 'asker',width: 85,editor: { xtype: 'textfield'}},
					{xtype: 'gridcolumn', header: '预约号',dataIndex: 'yuyueid',width: 85,editor: { xtype: 'textfield'}},
					{xtype: 'gridcolumn', header: '姓名',dataIndex: 'name',width: 85,editor: { xtype: 'textfield'}},
					{xtype: 'gridcolumn', header: '代约人',dataIndex: 'proxyer',width: 85,editor: { xtype: 'textfield'}},
					{xtype: 'gridcolumn', header: '电话',dataIndex: 'phone',width: 85,editor: { xtype: 'textfield'}},
					{xtype: 'gridcolumn', header: '性别',dataIndex: 'sex',width: 85,editor: Ext.user.edit.sex,renderer:Ext.user.renderer.sex},
					{xtype: 'gridcolumn', header: '年龄',dataIndex: 'year',width: 85,editor: { xtype: 'textfield'}},
					{xtype: 'gridcolumn', header: '专家',dataIndex: 'proficient',width: 85,editor: { xtype: 'textfield'}},
					{xtype: 'gridcolumn', header: '时间（起）',dataIndex: 'starttime',width: 85,editor: {xtype: 'datefield'} },
					{xtype: 'gridcolumn', header: '时间（止）',dataIndex: 'endtime',width: 85,editor: {xtype: 'datefield'} },
					{xtype: 'gridcolumn', header: '就诊号',dataIndex: 'Medicalnumber',width: 85,editor: { xtype: 'textfield'}},
					{xtype: 'gridcolumn', header: '就诊时间',dataIndex: 'Clinicaltime',width: 85,editor: {xtype: 'datefield'} },
					{xtype: 'gridcolumn', header: '回访情况',dataIndex: 'visit',width: 85,editor: Ext.user.edit.visit,renderer:Ext.user.renderer.visit},
					{xtype: 'gridcolumn', header: '备注',dataIndex: 'comment',width: 300,editor: {xtype: 'textfield'}}

				]);
Ext.user.yuyuetbaradd = {text:'添加行',handler:function(){
	var adddata = Ext.data.Record.create(['id','title']);
	Ext.user.yuyuedata.add(new adddata([]));
}};
Ext.user.yuyuetbarsave = {text:'保存',handler:function(){
	var aa = Ext.user.yuyuedata.getModifiedRecords();
	Ext.user.method.submitData({url:'/User/',params:{post:'aaa'},Data:Ext.user.method.json(aa)});
}};
Ext.user.yuyue = Ext.extend(Ext.Panel, { 
    border: false,
	renderTo:'yuyue_index',
    initComponent: function() {
        this.items = [
            {
                id:'yuyue_index_editorgrid',tbar:[Ext.user.yuyuetbaradd,Ext.user.yuyuetbarsave],xtype: 'editorgrid', clicksToEdit:1,title: '用户列表', store:Ext.user.yuyuedata,height:500, columnLines: true, frame: true,trackMouseOver:true,
				columnLines:true,cm: Ext.user.yuyuecolumn
			}	
        ];
		
        Ext.user.yuyue.superclass.initComponent.call(this);
    }
});
//数据
Ext.user.edit.myData = [{},{},{},{},{},{}];
Ext.user.yuyuedata = new Ext.data.ArrayStore({
        fields: [
           'time','ipaddr','city','gopage','askpage','keyword','binzhong','askway','qq','asker','yuyueid','name','proxyer','phone','sex','year','proficient','starttime','endtime','Medicalnumber','Clinicaltime','visit','comment',
        ],
        data: Ext.user.edit.myData
    });
